package com.noodles.mall.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.noodles.mall.entity.parent.BaseEntity;

import java.time.LocalDateTime;
import java.util.List;

import com.noodles.mall.service.OrderItemService;
import com.noodles.mall.service.OrderService;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 *
 * </p>
 *
 * @author noodles
 * @since 2021-02-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_order")
public class Order extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户
     */
    private Integer userId;

    /**
     * 订单编号
     */
    private String orderCode;

    /**
     * 应付金额
     */
    private BigDecimal payment;

    /**
     * 状态（0未付款，1已付款，2未发货，3已发货，4交易成功，5交易关闭，6交易失败）
     */
    private Integer status;

    /**
     * 买家留言
     */
    private String buyerMessage;

    /**
     * 付款时间
     */
    private LocalDateTime paymentTime;

    /**
     * 发货时间
     */
    private LocalDateTime dispatchTime;

    /**
     * 物流名称
     */
    private String dispatchName;

    /**
     * 物流编号
     */
    private String dispatchCode;

    /**
     * 交易完成时间
     */
    private LocalDateTime tradeEndTime;

    /**
     * 交易关闭时间
     */
    private LocalDateTime tradeCloseTime;

    /**
     * 收货人名称
     */
    private String receiverName;

    /**
     * 手机号
     */
    private String receiverMobile;

    /**
     * 收货城市
     */
    private Integer receiverCityId;

    /**
     * 收货具体地址
     */
    private String receiverAddress;

    @TableField(exist = false)
    private List<OrderItem> orderItemList;
}
